<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="Keywords" content="网站关键词">
    <meta name="Description" content="网站介绍">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/reg.css">
</head>
<body>
<div id="ajax-hook"></div>
<div class="wrap">
    <div class="wpn">
        <div class="form-data pos">
            <a href=""><img src="./img/logo.png" class="head-logo"></a>
            <div class="change-login">
                <p class="account_number on">账号登录</p>
            </div>
            <div class="form1">
                <p class="p-input pos">
                    <label for="num">手机号</label>
                    <input type="text" id="num">
                    <span class="tel-warn num-err hide"><em>账号或密码错误，请重新输入</em><i class="icon-warn"></i></span>
                </p>
                <p class="p-input pos">
                    <label for="pass">请输入密码</label>
                    <input type="password" style="display:none"/>
                    <input type="password" id="pass" autocomplete="new-password">
                    <span class="tel-warn pass-err hide"><em>账号或密码错误，请重新输入</em><i class="icon-warn"></i></span>
                </p>
            </div>
            <div class="r-forget cl">
                <a href="/user_register" class="z">账号注册</a>
            </div>
            <button class="lang-btn off log-btn">登录</button>
            <p class="right">Powered by © 2019</p>
        </div>
    </div>
</div>
<script src="./js/jquery.js"></script>
<script src="./js/agree.js"></script>
<script src="./js/login.js"></script>
<script type="text/javascript">
$(function(){
	//点击登录按钮事件
	$(".log-btn").click(function(){
		var $userphone = $("#num").val();
		var $userpassword = $("#pass").val();
		var data = "userphone="+$userphone+"&userpassword="+$userpassword;
		$.ajax({
			type:'POST',
			dataType:"json",
			url:'/user_login',
			data:data,
			success:function(data){//返回json结果
				if(data.data=="success"){
					location = '/indexs';
				}else if(data.data=="false"){
					location = '/login';
				}else if(data.data=="error"){
					alert("对不起您没有权限！");
				}else if(data.data=="pwdfalse"){
					alert("密码错误！");
				}
			},
			error:function(data){
		        //请求出错处理
		        alert("出现异常");
		    }
		})
	})
})

</script>
<div style="text-align:center;">
<p>更多模板：<a href="http://www.mycodes.net/" target="_blank">源码之家</a></p>
</div>
</body>
</html>